<!-- Page statistics and control buttons area -->
    <div class="statsRow">
        <div class="wrapper statsItems">
         <table style="width:100%">
		 <tbody>
		 <tr>
		 <td>
		 Адрес сайта: <a href="#" title=""><?php echo $this->site[0]['url']; ?></a>
		 </td>
		 <td>
		 дата добавления: <?php echo $this->site[0]['date']; ?>
		 </td>
		 <td>
		 Тематика: <?php echo $this->site[0]['category']; ?>
		 </td>
		 <td>
		 Рекламных мест: <?php echo count($this->adv_space); ?>
		 </td>
		 </tr>
		 <tr>
		 <td>
		 Статус: <?php echo $this->site[0]['status']; ?>
		 </td>
		 <td>
		 <a class="button greenB" style="margin: 5px;" title="" href="#"><span>сгенерировать РМ</span></a>
		 </td>
		 <td>
		 <a class="button dblueB" style="margin: 5px;" title="" href="#"><span>статистика</span></a>
		 </td>
		 <td>
		 <a class="button dredB" style="margin: 5px;" title="" href="#"><span>удалить</span></a>
		 </td>
		 </tr>
		 <tbody>
		 </table>
		</div>
    </div>
	<div class="line"></div>

    <!-- Main content wrapper -->
    <div class="wrapper">
	<div class="widget">
                    <div class="title"><img src="/images/icons/dark/frames.png" alt="" class="titleIcon" /><h6>Рекламные места</h6></div>
          <table cellpadding="0" cellspacing="0" width="100%" class="sTable">
              <thead>
                  <tr>
                      <td>ID</td>
                      <td>Расположение</td>
                      <td>Дата добавления</td>
                      <td>Тип рекламы</td>
                      <td>Длина очереди показа</td>
					  <td>Статус</td>
					  <td>Управление</td>
                  </tr>
              </thead>
              <tbody>
                  <?php foreach ($this->adv_space as $val) { ?>
                  <tr>
                      <td><?php echo $val['id']; ?></td>
                      <td><?php echo '<a href="'.$val['location'].'">'.$val['location'].'</a>'; ?></td>
                      <td><?php echo $val['date']; ?></td>
                      <td><?php echo $val['type']; ?></td>
                      <td><?php echo $val['length_queue']; ?></td>
		      <td><?php echo $val['status']; ?></td>
                      <td>
                          <?php echo '<a href="'.$this->url(array(
                              'module'     => 'front',
                              'controller' => 'publisher',
                              'action'     => 'statisticadvspace',
                              'id'         => $val['id'],
                              'site'      => $this->site[0]['id']
                          )).'">статистика</a>' ?> 
                          <?php echo '<a href="'.$this->url(array(
                              'module'     => 'front',
                              'controller' => 'publisher',
                              'action'     => 'reportadvspace',
                              'id'         => $val['id']
                          )).'">отчет</a>' ?>
                          <?php
                          if ($val['status'] === 'blocked' ) {
                              echo '<a href="'.$this->url(array(
                                  'module'     => 'front',
                                  'controller' => 'publisher',
                                  'action'     => 'modeadvspace',
                                  'id'         => $val['id'],
                                  'param'      => 'activation',
                                  'site'      => $this->site[0]['id']
                              )).'">активировать</a>'; 
                          } elseif ($val['status'] === 'active') {
                              echo '<a href="'.$this->url(array(
                                  'module'     => 'front',
                                  'controller' => 'publisher',
                                  'action'     => 'modeadvspace',
                                  'id'         => $val['id'],
                                  'param'      => 'deactivation',
                                  'site'      => $this->site[0]['id']
                              )).'">заблокировать</a>';
                          }
                          ?>
                          <?php echo '<a href="'.$this->url(array(
                              'module'     => 'front',
                              'controller' => 'publisher',
                              'action'     => 'deleteadvspace',
                              'id'         => $val['id'],
                              'site'      => $this->site[0]['id']
                          )).'">удалить</a>' ?>
                      </td>
		  </tr>		 
                  <?php } ?>                          					                 
              </tbody>
          </table>
    </div>
	</div>
	<div class="line" style="margin-top:20px;"></div>